import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
		path: '/login',
		component: () => import('@/views/Login.vue')
	},
	{
		path: '/',
		component: () => import('@/views/Index.vue'),
		children: [
			{
				// 当 /user/:id/profile 匹配成功，
				// UserProfile 会被渲染在 User 的 <router-view> 中
				path: 'userInfos',
				component: () => import('@/views/UserInfos.vue')
			},
			{
				// 当 /user/:id/profile 匹配成功，
				// UserProfile 会被渲染在 User 的 <router-view> 中
				path: 'items',
				component: () => import('@/views/Items.vue')
			}
		]
	}
]

const router = new VueRouter({
	routes
})

export default router
